package com.example.module_home.api

import com.example.lib_common.view.api.BaseApiServer
import com.example.module_home.entity.AddDeviceEntity
import com.example.module_home.entity.DeviceEntity
import com.example.module_home.entity.DeviceEntityItem
import com.example.module_home.entity.DeviceOrderEntityItem
import com.example.module_home.entity.HomeListEntity
import com.example.module_home.entity.HouseEntity
import com.example.module_home.entity.NoticeEntity
import com.example.module_home.model.HomeResultData
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface HomeApiServer :BaseApiServer{
    @GET("/api/announcements")
    suspend fun getNotice(@Query("page") page:Int, @Query("size") size:Int):HomeResultData<NoticeEntity>


    @GET("/api/properties")
    suspend fun getHouse():HomeResultData<List<HouseEntity>>
    //根据id查询
    @GET("/api/properties/region/{regionId}")
    suspend fun getQueryHouseId(@Path("regionId") regionId :Int):HomeResultData<List<HouseEntity>>
    @GET("/api/properties/search")
    suspend fun getHouseSearch(@Query("keyword") keyword:String):HomeResultData<List<HouseEntity>>


    @GET("/api/devices")
    suspend fun getDevice():HomeResultData<List<DeviceEntityItem>>
    @POST("/api/devices")
    suspend fun getAddDevice(@Body body:AddDeviceEntity):HomeResultData<DeviceEntityItem>
    @GET("/api/inspection-orders")
    suspend fun getDeviceOrder():HomeResultData<List<DeviceOrderEntityItem>>
}